import request from '@/utils/request'
const path = ""

export function exportExcel(data) {
  return request({
    url: path + '/user/exportExcel/',
    method: 'post',
    data
  })
}

/* 登录接口
params {
  username or phone Y
  password Y
}
*/
export function login(data) {
  return request({
    url: path + '/user/login/',
    method: 'post',
    data
  })
}
/* 获取用户信息接口
@param 无
*/
export function getInfo(data) {
  return request({
    url: path + '/user/getUserInfo/',
    method: 'post',
    data
  })
}
/* 获取所有用户列表
@param username、phone、nickname等条件查询
*/
export function findUserList(params) {
  return request({
      url: path + '/user/',
      method: 'get',
      params
  })
}
export function finduserTree(params) {
  return request({
      url: path + '/userTree/',
      method: 'get',
      params
  })
}
/* 根据用户ID获取某个用户信息
@param userId Y
*/
export function getUserInfoById(data) {
  return request({
      url: path + '/user/getUserInfoById/',
      method: 'post',
      data
  })
}
/* 根据用户ID修改某个用户信息
@param username、phone、nickname等参数
*/
export function updateUserByUserId(data) {
  return request({
    url: path + '/user/updateUserByUserId/',
    method: 'post',
    data
  })
}

/* 新增用户
@param username、phone、nickname等参数
*/
export function createUser(data) {
  return request({
    url: path + '/user/createUser/',
    method: 'post',
    data
  })
}
/* 退出登录
@param 无
*/
export function logout(data) {
  return request({
    url: path + '/user/logout/',
    method: 'post',
    data
  })
}
  /* 删除
@param wheelId Y
*/
export function deleteUsers(data) {
  return request({
      url: path + '/user/deleteAction/',
      method: 'post',
      data
  })
}
export function resetOldData(data) {
  return request({
    url: path + '/user/resetOldData/',
    method: 'post',
    data
  })
}

export function resetPwdForAdmin(data) {
  return request({
    url: path + '/user/resetPwdForAdmin/',
    method: 'post',
    data
  })
}

//充值
export function updateUserForAddIncome(data) {
  return request({
    url: path + '/user/updateUserForAddIncome/',
    method: 'post',
    data
  })
}
//扣除
export function updateUserForSubIncome(data) {
  return request({
    url: path + '/user/updateUserForSubIncome/',
    method: 'post',
    data
  })
}

export function getUserInfoByCode(data) {
  return request({
    url: path + '/user/getUserInfoByCode/',
    method: 'post',
    data
  })
}
export function updateUserForParent(data) {
  return request({
    url: path + '/user/updateUserForParent/',
    method: 'post',
    data
  })
}